package collection;

import javafx.print.Collation;

import java.awt.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
/*
集合重写了Object的toString()方法;具体如:[元素.toString]
 */
public class CollectionDemo {
    public static void main(String[] args) {
        Collection c=new ArrayList();
        c.add(new Point(2,3));
        c.add(new Point(2,3));
        c.add(new Point(5,3));
        System.out.println(c);
        Point p=new Point(5,8);
        boolean o=c.contains(p);
        System.out.println("?"+o);
        c.remove(p);
        System.out.println(c);
        Collection cc=new ArrayList();
        Point pp=new Point(1,8);
        cc.add(pp);
        System.out.println(pp);
        System.out.println(cc);
        pp.setX(100);
        System.out.println(pp);
        System.out.println(cc);
    }
}
